<?php
// +----------------------------------------------------------------------
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
// +----------------------------------------------------------------------

namespace app\common\validate;

/**
* 设置模型
*/
class User extends Base{

    protected $rule = array(
        'loginname' =>  'require|unique:User',
        'password' =>  'min:6',
        'username'  =>  'require|min:6|max:30',
        'status' =>  'require',
        'sex' =>  'require',
        
    );

    protected $message = array(
        //'loginname' =>  '登录账号不能为空',


        'username'  =>  '用户名必填',
        'username.min'  =>  '用户名过短...',
        'username.max'  =>  '用户名太长...',
        'status'   =>  '状态必选',
        'sex'         =>  '请选择性别',
    );

    protected $scene = array(
        'add'   => array('loginname','password','username'),
        'edit'  => array('password','username'),
        'password'  => array('password'),
    );

    protected $field = array(
        'loginname' =>  '登录账号',
        'password' =>  '密码',
        'username' =>  '用户名',
        'status' =>  '状态',
        'sex' =>  '性别',
        
    );



    public function xxx($value , $data){
        dump($value);
        dump($data);
        return 'XXX验证失败！！！'; //验证失败
    }

}